import Mock from 'mockjs'

/**
 * 分页获取列表
 */
export const getSaleCheckoutOrderPage = async (
  params: pagination & SaleCheckoutOrder
): Promise<ListSaleCheckoutOrderRes> => {
  const res = await Mock.mock({
    'list|10': [
      {
        'id|+1': 1,
        nickName: '@cname',
        avatar: '@image(200x200,@color,@color,@word)',
        orderNo: '@integer(13000000000, 18999999999)',
        'checkoutType|1': ['OFFLINE', 'TAX', 'WXQB', 'WXFZ'],
        checkoutAccount: '@integer(0, 100)',
        checkoutStatus: '@integer(0, 1)',
        createTime: 1691143890537
      }
    ],
    pageNo: 1,
    pageSize: 10,
    total: 30
  })
  return res
}

/**
 * 获取结算记录
 */
export const getCheckoutOrder = async (id: number): Promise<SaleCheckoutOrder> => {
  const res = await Mock.mock({
    data: {
      'id|+1': 1,
      nickName: '@cname',
      avatar: '@image(200x200,@color,@color,@word)',
      orderNo: '@integer(13000000000, 18999999999)',
      'checkoutType|1': ['OFFLINE', 'TAX', 'WXQB', 'WXFZ'],
      checkoutAccount: '@integer(0, 100)',
      checkoutStatus: '@integer(0, 1)',
      createTime: 1691143890537
    }
  })
  return res
}

/**
 * 更新结算信息
 */
export const updateCheckoutOrder = async (params: SaleCheckoutOrder): Promise<ResStatus> => {
  const res = await Mock.mock({
    isSuccess: true
  })
  return res
}

/**
 * 删除结算记录
 */
export const deleteCheckoutOrder = async (id: number): Promise<ResStatus> => {
  const res = await Mock.mock({
    isSuccess: true
  })
  return res
}
